<%= form_tag '', :method => :get, :id => 'sidebar_products_search' do  %>
  <% params[:search] ||= {} %>
  <input type="hidden" name="per_page" value="<%= params[:per_page] %>"/>
	
	<% filters = @taxon ? @taxon.applicable_filters : [ProductFilters.all_taxons] %>
  <% filters.each do |filter| %>
    <% labels = filter[:labels] || filter[:conds].map {|m,c| [m,m]} %>
    <% next if labels.empty? %>
		
	<div class="price-range">
		<h4 class="sechead"><%= filter[:name] %></h4>
		<div class="inner-list">
			<% labels.each do |nm,val| %>
			<% label = "#{filter[:name]}_#{nm}".gsub(/\s+/,'_') %>
					<div class="chckbox-wrap">
						<input type="checkbox" class="chck-bx" 
                   id="<%= label %>"
                   name="search[<%= filter[:scope].to_s %>][]"
                   value="<%= val %>"
                   <%= params[:search][filter[:scope]] && params[:search][filter[:scope]].include?(val.to_s) ? "checked" : "" %> />
					<span><%= nm %></span></div>
			<% end %>
		</div>
		</div>
	<% end %>
  <%= submit_tag t(:search), :name => nil ,:class=>"continue button primary"%>
<% end %>